package fun.xinnix.controller;

import fun.xinnix.entity.Result;
import fun.xinnix.service.ConsumerService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/consumer")
public class ConsumerController {
    @Resource
    ConsumerService consumerService;

    @PostMapping("/createOrder")
    public Result createOrder(String username) {
        return Result.success(consumerService.createOrderByUser(username));
    }
}
